Skip to content

Code cleanup with regard to PR 414, operator overloads and default constructor for WebRequestMethodComposite#415

Merged
mathieucarbou merged 4 commits intomainfrom
cleanup
Mar 18, 2026
Merged

Code cleanup with regard to PR 414, operator overloads and default constructor for WebRequestMethodComposite#415
mathieucarbou merged 4 commits intomainfrom
cleanup

Conversation

@mathieucarbou
Copy link
Member

No description provided.

@mathieucarbou mathieucarbou requested review from Copilot and willmmiles and removed request for Copilot March 18, 2026 13:18
@mathieucarbou mathieucarbou self-assigned this Mar 18, 2026
Copilot AI review requested due to automatic review settings March 18, 2026 13:20
@mathieucarbou mathieucarbou review requested due to automatic review settings March 18, 2026 13:20
Copilot AI review requested due to automatic review settings March 18, 2026 13:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds/adjusts WebRequestMethodComposite comparison and move behavior to support method-composite usage across the server and examples.

Changes:

  • Updates WebRequestMethodComposite operators and adds explicit copy/move ctor/assignment implementations.
  • Propagates std::move for WebRequestMethodComposite through handler setMethod() calls.
  • Fixes example sketches to reference AsyncWebRequestMethod::HTTP_* constants.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/WebServer.cpp Moves method into handlers when registering routes.
src/WebHandlerImpl.h Moves method into _method in setMethod().
src/ESPAsyncWebServer.h Alters WebRequestMethodComposite operators; adds copy/move ctors and assignments.
src/AsyncJson.h Moves method into _method in JSON handler setMethod().
examples/HTTPMethodsWithESPIDF/HTTPMethodsWithESPIDF.ino Updates method enum references to AsyncWebRequestMethod::HTTP_*.
examples/HTTPMethodsWithArduino/HTTPMethodsWithArduino.ino Updates method enum references to AsyncWebRequestMethod::HTTP_*.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@willmmiles willmmiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid redefining the default constructors and operators -- the language builtins are almost always faster.

If the language requires explicit specification use =default to get the benefits of the internally optimized versions.

Copy link

@willmmiles willmmiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@mathieucarbou
Copy link
Member Author

@willmmiles also added 2 commits to fix #414 based on your comment (#414 (comment)) plus another one I saw that already existed.

@mathieucarbou mathieucarbou changed the title Added == operator overload for WebRequestMethodComposite Code cleanup in regards to PR 414 and operator overload for WebRequestMethodComposite (== and !=) Mar 18, 2026
@mathieucarbou mathieucarbou changed the title Code cleanup in regards to PR 414 and operator overload for WebRequestMethodComposite (== and !=) Code cleanup with regard to PR 414 and operator overload for WebRequestMethodComposite (== and !=) Mar 18, 2026
@mathieucarbou mathieucarbou changed the title Code cleanup with regard to PR 414 and operator overload for WebRequestMethodComposite (== and !=) Code cleanup with regard to PR 414, operator overloads and default constructor for WebRequestMethodComposite Mar 18, 2026
@mathieucarbou mathieucarbou merged commit f105f52 into main Mar 18, 2026
33 checks passed
@mathieucarbou mathieucarbou deleted the cleanup branch March 18, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants